package br.unesp.rc.rafaelt.util;




public class SpringUtils {
    
    //private static final Logger LOGGER = LoggerFactory.getLogger(SpringUtils.class);
    
    private static ApplicationContextProvider testApplicationContext = null;
    
    private SpringUtils() {
    }
    
    /**
     * Define the Test Application Context for JUnit Projects
     * @param applicationContext
     */
    public static void setTestApplicationContext(final ApplicationContextProvider applicationContext) {
        testApplicationContext = applicationContext;
    }
    
    /*public static <T> T getBean(Class<T> clazz) {
        ApplicationContext context = ContextLoader.getCurrentWebApplicationContext();
        if (context == null && testApplicationContext != null) {
            context = testApplicationContext;
        } else if (context == null) {
            //LOGGER.error("Could not get the Application Context for the current thread. Maybe you are not running a Web Application?");
            return null;
        }
        return context.getBean(clazz);
    }*/
}
